(1) Field of the Invention
This invention relates to an image decoding apparatus for decoding coded data to generate moving pictures, the data having been coded in conformity with a standard such as Moving Picture Experts Group (MPEG).
(2) Description of the Prior Art
Recently, great efforts have been made to develop efficient techniques for coding/compressing moving pictures. These techniques, such as MPEG, are used in the fields of computers, communications, broadcasting, etc.
According to MPEG, the moving pictures are divided into frames, each frame being divided into a plurality of blocks, and each block generally including 64 pixels (8 pixels.times.8 pixels). The moving picture data is encoded block by block for each frame. The encoding procedure includes processes such as motion estimation, Discrete Cosine Transformed (DCT) being an orthogonal transformation, quantization, and entropy coding. The original moving picture data changes into coded data (bitstreams) through the above processes. Moving pictures are restored from the bitstreams by going through a reversed procedure of the coding procedure which includes entropy decoding (dividing and decoding of the bitstreams), dequantization, inverse DCT, and motion compensation.
The following is a description of the principle of "predictive coding" cited from "Gazou Deta Asshuku No Kiso Chishiki (Basic Knowledge of Image Data Compression)," Interface, December 1991, CQ Publishing Co. Predictive coding is a method of predicting current pixel values from preceding pixel values using a difference between a true value and a predictive value, the difference being called a predictive error. The method uses a unique characteristic of image data that the luminances of adjacent pixels strongly correlate.
The FIG. 1, pixel (luminance) value sequence 1112 (0, 0, 0, 1, 0, 3, 1, 0, 1, 1, . . . ) are actual values of original pixel value Xi 1102 which are processed in sequence. The luminance appears to increase gradually from the left-hand side to the right-hand side in this case. In the present description, it is assumed that each pixel holds a pixel (luminance) value ranging from "0" to "15." The numbers in the column of pixel number i 1101 represent serial numbers assigned to pixels processed in sequence. As shown in the drawing, the sequence 1112 of the original pixel value X11102 does not appear to change greatly in each pair of adjacent pixels. By using this characteristic, it is possible for a receiver to approximately predict each of the next pixel values. It is further possible for a transmitter to assume that the receiver will predict each next pixel value. As a result, after sending an original pixel value X11102, the transmitter transmits a difference D2=X2 Y1, where Y1 represents a predictive value (-X1), and X2 represents a true value. The receiver obtains the true value X2 by adding the difference D2 to the pixel value X1.
The transmitter regards a value X.sub.i-1 as a predictive value Yi 1103 (Yi-X.sub.i-1). The transmitter calculates predictive difference Di 1104 between predictive value Yi 1103 and true value Xi 1102. Thus, Di=Xi-Yi. The transmitter sends the calculated predictive difference Di 1104 as transmission value Ti 1105 to the receiver via transmission path 1106. The receiver receives the transmission value Ti 1105 as reception value Ri 1107 (Ri=Ti). The receiver generates decoded value Zi 1108 by adding preceding decoded value Z.sub.i-1 to the reception value Ri 1107 (Zi=Z.sub.i-1 +Ri). After going through the above procedure, a decoded-value sequence 1118 (0, 0, 0, 1, 0, 3, 1, . . . ) is generated. Note that a pixel holding the pixel value X.sub.i-1 preceding the original pixel value Xi is called a reference pixel.
The above method is the simplest one in which a preceding pixel is treated as a predictive value. This type of predictive coding method using pixel values of preceding pixels is called forward predictive coding, a predictive coding method using a succeeding pixel is called backward predictive coding; and a predictive coding method using a preceding pixel and a succeeding pixel is called bidirectional predictive coding.
The above predictive coding applied to adjacent pixels in a frame is called intra predictive coding. Also, this predictive coding applied to frames of moving picture data is called inter predictive coding.
In the above description of the principle, the predictive coding is performed for each pixel. In general, however, the predictive coding is performed for each block of 8 pixels.times.8 pixels. In this case, when a block is the same as the preceding block (called a reference block), Information indicating that these blocks are the same may be sent instead of 64 difference values "0", reducing the amount of transmitted information.
FIG. 2 shows a hierarchical structure of coded data which is generated by coding (compressing) moving picture data with a moving picture compression technique. As shown in a sequence layer 1201, a code sequence 1211 corresponding to a piece of moving picture data is divided into a plurality of Groups Of Pictures (GOP) 1212. Other information such as Sequence Header Code (SHC) is attached to each GOP when the codes are transmitted. As shown in a GOP layer 1202, each GOP 1212 is composed of a Group Start Code (GSC) being a start code of the GOP and a plurality of Intra-Coded Pictures (I pictures) 1221, Bidirectionally Predictive-Coded Pictures (B-pictures) 1222, and Predictive-Coded Pictures (P-pictures) 1223.
Each of I-pictures 1221, B-pictures 1222, and P-pictures 1223 includes the same amount of data as one frame.
The I-picture is a result of coding only one frame without obtaining a difference between the frame and other frames. The P-picture is a result of a predictive coding and includes difference values obtained from a calculation using pixel values of the current frame and the preceding frame. The B-picture is also a result of a predictive coding and includes difference values obtained from a calculation using pixel values of the current frame and the preceding and succeeding frames. As a result of this, in the decoding process, the preceding and succeeding frames of a B-picture must first be decoded before the B-picture itself is decoded. Similarly, a preceding frame should be decoded before a target P-picture is decoded.
As shown in picture layer 1203, each picture is composed of a Picture Start Code (PSC) 1233 for specifying a picture type of I-picture, P-picture, or B-picture, a Picture Coding Type (PCT) 1232, and a plurality of slices 1231.
Each slice 1231 corresponds to one of pixel sequences making up a horizontal line in a frame.
As shown in slice layer 1204, each slice 1231 is composed of a Slice Start Code (SSC) for indicating the start of the slice layer, and a plurality of Macroblocks (MB) 1241.
As shown in macroblock layer 1205, each macroblock 1241 is composed of a plurality of Blocks (B) 1251 and information such as MacroBlock Type (MBT) 1615 specifying a macroblock type such as I-picture, P-picture, or B-picture, Motion Horizontal Forward Code (MHF) 1252 indicating a horizontal element of a forward motion vector of macroblock 1241, Motion Vertical Forward Code (MVF) 1253 indicating a vertical element of the forward motion vector of macroblock 1241, Motion Horizontal Backward Code (MHB) 1254 indicating a horizontal element of a backward motion vector of macroblock 1241, Motion Vertical Backward Code (MVB) 1255 indicating a vertical element of the backward motion vector of macroblock 1241, and Coded Block Pattern (CBP) 1256 specifying a pattern of six blocks included in microblock 1241.
The blocks 1251 are generally composed of six blocks 1261, 1262, 1263, 1264, 1265, and 1266. Blocks 1261, 1262, 1263, and 1264 are each composed of an element specifying a luminance, and blocks 1265 and 1266 are each composed of an element specifying a chrominance.
The block 1271 is generally composed of 64 pixels 1272 arrayed as 8.times.8 pixels in vertical and horizontal directions.
Coded Block Pattern (CBP) 1256 is included only in the macroblocks of P-picture and B-picture and is a pattern of the blocks making up each macroblock.
Some blocks of P-picture and B-picture may be equal to corresponding ones in preceding/succeeding microblocks, and other blocks may not. Blocks being different from corresponding ones in preceding/succeeding macroblocks include difference values after the predictive coding; blocks being equal to those of preceding/succeeding macroblocks do not include difference values.
The block including difference values are called "skipped blocks"; the blocks including no difference values are called "not-skipped blocks." T-pictures are composed of only "not-skipped blocks." P-pictures and B-pictures are composed of "skipped blocks" and "not skipped blocks." This is the same with macroblocks.
A conventional image decoding apparatus is provided with an entropy decoding unit and a constant generating unit which operate in parallel. The entropy decoding unit entropy decodes the coded data in units of blocks. The constant generating unit generates blocks which consist of constants "0" for the skipped blocks. The entropy-decoded blocks and the blocks consisting of constants "0" then go through a dequantization process and an Inverse Discrete Cosine Transform (IDCT) process.
Error such as a partial data deletion or garbage may occur while the coded data is transmitted. When this happens, decoded data may result in a coding error, out-of-range error, or a motion vector error. The coding error happens when a variable length code not listed in a decode table is detected. The out-of-range error occurs when a motion vector value exceeds a predetermined range. The motion vector error occurs when a motion vector value exceeds a reference unit image range.
The constant generating unit generates a block consisting of constants "0" when such an error occurs so that the error block is replaced by the constant "0" block.
FIG. 4 shows the change with time in the processes performed by the conventional image decoding apparatus for each block. The drawing lists a bitstream analyzing unit, entropy decoding unit, constant generating unit, a combination of dequantization unit and IDCT unit, and image restoring unit to show blocks processed by these units in time sequence. Each block is handled by these units in this order. In the drawing, blocks B10, B12, and B14 are "not-skipped blocks"; block B11 is a "skipped block," and block B13 is a block including an error. C30-C33, C34-C37, C38-C41, C42-C45, and C46-C49 represent sets of processes respectively performed for blocks B10, B11, B12, B13, and B14.
As apparent from the above description, in the conventional image decoding apparatus, the dequantization unit and the IDCT unit process "skipped blocks," "not-skipped blocks," and error blocks all in the same way.
However, in case of "skipped blocks" and error blocks, processes by the dequantization unit and the IDCT unit are not necessary, in reality. The execution or these processes on such blocks decreases the processing speed.
On detecting a motion vector error in a block in a current slice, the conventional image decoding apparatus detects the start of the next slice to skip to the next slice. This becomes another factor for decreasing the processing speed.
Note that the conventional image decoding apparatus described above processes data in units of blocks, the unit image being a block. However, the same problems occur when data is processed in units of macroblocks.